<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/2/19 0019
 * Time: 16:12
 */

//注册自加载

spl_autoload_register('autoload');

function autoload($class)
{
    require dirname($_SERVER['SCRIPT_FILENAME']) . '//..//' . str_replace('\\', '/', $class) . '.php';
}

/*********** test *************/

use singleton\Singleton;

//获取单例
$instance = Singleton::getInstance();
$instance->test();

$instanceClone = clone $instance;